clear all
close all
clc

load('modeldata_final_100K_b1.mat')
close all
hold off
paramval = iota_m.*(1-[0 .1]) ;
for i = 1:length(paramval)
    i
   [wstar(:,i),cumcomp(:,i),cumulsum(:,i),meanacceptedw(:,i),expectedw(:,i),proboffer(:,i),probs(:,i),~,~,~,~] = ...
       modelsolve_endosearch(paramval(i),b_m,zeta_m,mu0_m,gam_m,mustar_m,sigstar_m,scost_m,lam_m,bet,capT,capT2*10,Nw,Nwlong,cumcomp_m_dat,beliefs_m_dat,proboffer_m_dat,cumsum_m_dat) ;

end


date2 = linspace(1,capT2*10,capT2*10)
h1 = figure(1) ;
plot(date2,wstar(:,1),'-ko',...
   date2,wstar(:,2),'-kx','Linewidth',2)
ylabel('reservation wage','FontSize',24)
xlim([1 21])
h = legend(['$\iota$=' num2str(paramval(1))],['$\iota$=' num2str(paramval(2)) '' ],'Fontsize',24)
set(h, 'Interpreter', 'latex')
print -depsc2 figures/figure3a.eps

h2 = figure(2) ;
plot(date2,proboffer(:,1)./lam_m,'-ko',...
   date2,proboffer(:,2)./lam_m,'-kx','Linewidth',2)
ylabel('probability of searching','FontSize',24)
xlim([1 21])
h = legend(['$\iota$=' num2str(paramval(1))],['$\iota$=' num2str(paramval(2)) '' ],'Fontsize',24)
set(h, 'Interpreter', 'latex')
print -depsc2 figures/figure3c.eps


